<?php

class SimpleFactory
{
    public static function createLeifeng($type)
    {
        switch ($type) {
            case '大学生志愿者':
                return new Undergraduate();
            case '社区志愿者':
                return new Volunteer();
            default:
                throw new Exception('志愿者类型异常');
        }
    }
}